import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpArticleComment {
  id!: number;
  cid: number = 0;
  uid: number = 0;
  articleId!: number;
  userId!: number;
  content!: unknown;
  time!: string;
  state: boolean = true;
  uniacid!: number;
}

export const ImsYzdKpArticleCommentSchema = new EntitySchema({
  class: ImsYzdKpArticleComment,
  properties: {
    id: { primary: true, type: 'number' },
    cid: { type: 'number', default: 0, index: 'cid' },
    uid: { type: 'number', default: 0, index: 'uid' },
    articleId: { type: 'number', index: 'article_id' },
    userId: { type: 'number', index: 'user_id' },
    content: { type: 'unknown', columnType: 'longtext' },
    time: { type: 'string', length: 255 },
    state: { type: 'boolean', default: true },
    uniacid: { type: 'number', index: 'uniacid' },
  },
});
